package com.hainingtong.main.scheduler;

import com.hainingtong.common.utils.RedisUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;

@Service
public class SchedulerTask {

    @Autowired
    private RedisUtils redisUtils;

    @Scheduled(cron = "*/1 * * * * ?")
    private void process(){
        //        if(!redisUtils.exists("test")){
        //            redisUtils.set("test", 1);
        //        }
        //        int n = Integer.parseInt(redisUtils.get("test").toString());
        //        redisUtils.set("test", n+1);
        //        System.out.println("this is scheduler task running " + n);
    }
}